import base from '../../base_url';
const homeindex = {
  // 广告
  adlist(id, params) {
    return id.get(`${base.host}` + "adver/getAdverList", { params: params })
  },
  // 新闻
  indexNew(id, params) {
    return id.post(`${base.host}` + "adver/getAdverList", { params: params })
  },
  // 新增问询与建议
  saveInquiresInfo(id, params) {
    return id.post(`${base.host}` + "inquires/saveInquiresInfo", { params: params })
  },
  //文件上传
  saveFile(id, params) {
    return id.post(`${base.host}` + "annexFile/saveFile", { params: params })
  },
  //新闻列表
  newlist(id, params) {
    return id.post(`${base.host}` + "news/getNewsPage", { params: params })
  },
  //新闻详情
  newsinfo(id, params) {
    return id.get(`${base.host}` + "news/getNewsInfo", { params: params })
  },
  //首页数据
  homeAlldata(id, params) {
    return id.get(`${base.host}` + "index/index", { params: params })
  },

  // 获取个人信息
  getUserData(id, params) {
    return id.post(`${base.host}` + "user/getUserData", params, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  },

  // 获取个人中心选项内容
  getCommon(id, params) {
    return id.get(`${base.host}` + "user/getCommon", { params: params })
  },

  // 更新个人资料
  updateUserData(id, params) {
    return id.post(`${base.host}` + "user/updateUserData", params, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  },
  // 获取产品分类菜单
  promenudata(id, params) {
    return id.get(`${base.host}` + "product/getProductTypeTree", { params: params })
  },
  // 获取资料中心分类菜单
  checkType(id, params) {
    return id.post(`${base.host}` + "down/checkType", params, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  },

  // 添加收藏
  saveSysCollection(id, params) {
    return id.post(`${base.host}` + "sysDic/saveSysCollection", params)
  }

}

export default homeindex